package com.demo.mapper.riot;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;
import java.util.List;

@Mapper
public interface CleanMapper {
    // 比赛数据清理
    List<String> selectOutdatedMatches(@Param("thresholdTime") LocalDateTime thresholdTime,
                                       @Param("limit") int limit);
    int deleteMatchParticipants(@Param("matchIds") List<String> matchIds);
    int deleteMatchTeams(@Param("matchIds") List<String> matchIds);
    int deletePlayerMatches(@Param("matchIds") List<String> matchIds);
    int deleteMatches(@Param("matchIds") List<String> matchIds);

    // 排位数据清理
    int deleteOutdatedRankInfo(@Param("thresholdTime") LocalDateTime thresholdTime);

    // 召唤师数据清理
    List<String> selectInactiveSummoners(@Param("thresholdTime") LocalDateTime thresholdTime);
    int deleteSummonerInfo(@Param("puuids") List<String> puuids);
    int deleteSummoners(@Param("puuids") List<String> puuids);

    // 日志记录
    void logCleanup(@Param("cleanupType") String cleanupType,
                    @Param("deletedRows") int deletedRows,
                    @Param("durationSeconds") long durationSeconds);
}